fix: Queued-agent polling repeatedly loads and transfers full growing run output - #1089
Closed
sam-saffron-jarvis wants to merge 1 commit into
Closed
fix: Queued-agent polling repeatedly loads and transfers full growing run output#1089sam-saffron-jarvis wants to merge 1 commit into
sam-saffron-jarvis wants to merge 1 commit into
Conversation
Owner
|
Superseded by the completed implementation applied directly to current main, including the by-ID covering-index migration and terminal detail-fetch error handling. Closing per request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
GET /v2/runs/{id}using the existing output-free run columns and scanner.wait_for_jobs.Why this is high-value
Jarvis uses queued agents and jobs routinely, and
wait_for_jobspolls every five seconds. Previously every poll selected growing SQLite TEXT output fields, encoded them into JSON, transferred them, read the full body, and decoded it just to inspect status. For a run with 1 MiB of accumulated output polled 100 times, that means roughly 100 MiB of avoidable transfer and decoding.After this change, polling cost is bounded by the small status/metadata projection; large output is read, encoded, transferred, and decoded only once at completion. This reduces SQLite reads, JSON CPU, network traffic, and transient allocations without changing the final tool result.
Validation
gofmt -w cmd/serve_jobs_v2.go cmd/serve_jobs_v2_test.go internal/tools/queue_agent.go internal/tools/queue_agent_test.gogo test ./internal/tools -run '^TestWaitForJobs' -count=1go test ./cmd -run '^TestJobsV2RunsSummaryOmitsOutputPayload$' -count=1go build ./...go test ./...: all packages passed except the pre-existinginternal/serveuiTestProductionBundleSizeBudgetsfailure (app.js427861 bytes vs 426000-byte raw budget). The same failure is present on upstreamdf774423CI: https://github.com/SamSaffron/term-llm/actions/runs/33309849469git diff --check